package com.example.design.mediator;

/**
 * TV, 具体同事类
 * @author hej
 * @date 2022/11/4 17:30
 */
public class TV extends Colleague {
    public TV(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name, this);
    }

    @Override
    void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange,this.getName());
    }

    public void startTv(){
        System.out.println("电视机开机。。。");
    }

    public void stopTv(){
        System.out.println("电视机关机。。。");
    }
}
